<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /**  点击按钮加50或者是减50，有一个过度效果就是图片  **/
        img {
            transition: all 1s;
        }

        button {
            margin-top: 20px;
        }
    </style>
</head>

<body>
    <!-- 任务 -->
    <div id="app">
        <img :width="width" :height="height" :src="url" alt="">
        <button @click="addWidth">宽度+50</button>
        <button @click="subWidth">宽度-50</button>
        <button @click="addHeight">高度+50</button>
        <button @click="subHeight">高度-50</button>
    </div>

    <script src="js/vue.global.js"></script>

    <script>
        Vue.createApp({
            data() {
                return {
                    url: './img/logo.png',
                    width: 200,
                    height: 200
                }
            },
            methods: {
                addWidth() {
                    this.width += 50
                },
                subWidth() {
                    this.width -= 50
                },
                addHeight() {
                    this.height += 50
                },
                subHeight() {
                    this.height -= 50
                }
            }
        }).mount("#app")
    </script>
</body>

</html>